package eu.flexthreading.test;

import org.jcsp.lang.*;
import org.jcsp.net.NetAltingChannelInput;

public class ReadProcess implements CSProcess 
{
	private NetAltingChannelInput in;
	private String name;
	
	public ReadProcess(NetAltingChannelInput in, String name) 
	{
		this.in = in;
		this.name = name;
	}
	
	public void run() 
	{
		while (true) 
		{
			String d = (String)in.read();
			System.out.println(name + " received: " + d);
		}
	}
}
